Skip to content

Conversation

epage
Copy link
Contributor

@epage epage commented Oct 6, 2025

To write colored output on a locked stream, you had to:

  1. Call process.stdout() to get a Box<dyn Writer>
  2. Call Writer::terminal(process) to get a ColorableTerminal (enum)
  3. Call ColorableTerminal::lock to get a ColorableTerminalLocked (enum)

This cuts out the first step, making sure everything goes through ColorableTerminal.

epage added 3 commits October 6, 2025 12:13
In a lot of cases, `Process` will create a boxed `Writer` just then to
create a `ColorableTerminal` from it.
This bypasses some of those steps, simplifying the code.
Copy link
Contributor

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff!

Copy link
Member

@rami3l rami3l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this patch :)

@rami3l rami3l added this pull request to the merge queue Oct 8, 2025
Merged via the queue into rust-lang:main with commit d6d6ecb Oct 8, 2025
29 checks passed
@epage epage deleted the cleanup2 branch October 8, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants